package com.shanxia.codec.enums;

import java.util.Objects;

public enum ChargingPreparationEnum {

    NOT_READY(0x00, "未做好充电准备"),
    READY(0xAA, "完成充电准备"),
    INVALID(0xFF, "无效"),
    UNKNOWN(99, "未知");

    public static ChargingPreparationEnum getByCode(int code) {
        for (ChargingPreparationEnum enums : ChargingPreparationEnum.values()) {
            if (Objects.equals(enums.code, code)) {
                return enums;
            }
        }
        return ChargingPreparationEnum.UNKNOWN;
    }

    ChargingPreparationEnum(int code, String name) {
        this.code = code;
        this.name = name;
    }

    public int code;
    public String name;
}